use serde::{Serialize, Deserialize};
use std::fmt::{Debug, Display};
use serde::de::{self, Unexpected, Visitor};
#[derive(Debug, Serialize, Deserialize)]
pub struct Result<T > {
    pub data: T,
    pub resultCode: i32, 
    pub message: String, 
}

pub fn success_result<T>(data :T) ->Result::< T> {
    Result::<T>{
        data: data ,
        resultCode : 200 ,
        message : "".to_owned(),
    }
}
pub fn fail_result(message :String) ->Result::<String> {
    Result::<String>{
        data: "".to_owned() ,
        resultCode : 500 ,
        message : message.to_owned(),
    }
}